home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / AIncludes / CoachMarks.a < prev    next >
Text File  |  1996-05-01  |  10KB  |  353 lines

  1. ;
  2. ;    File:        CoachMarks.a
  3. ;
  4. ;    Contains:    Public CoachMark programming interface.
  5. ;
  6. ;    Version:    Technology:    Copland
  7. ;                Release:    Universal Interfaces 3.0d3 on Copland DR1
  8. ;
  9. ;    Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10. ;
  11. ;    Bugs?:        If you find a problem with this file, send the file and version
  12. ;                information (from above) and the problem description to:
  13. ;
  14. ;                    Internet:    apple.bugs@applelink.apple.com
  15. ;                    AppleLink:    APPLE.BUGS
  16. ;
  17. ;
  18.     IF &TYPE('__COACHMARKS__') = 'UNDEFINED' THEN
  19. __COACHMARKS__ SET 1
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24.     IF &TYPE('__SOUND__') = 'UNDEFINED' THEN
  25.     include 'Sound.a'
  26.     ENDIF
  27.     IF &TYPE('__WINDOWS__') = 'UNDEFINED' THEN
  28.     include 'Windows.a'
  29.     ENDIF
  30.     IF &TYPE('__HIWINDOWTYPES__') = 'UNDEFINED' THEN
  31.     include 'HIWindowTypes.a'
  32.     ENDIF
  33.     IF FOR_SYSTEM8_COOPERATIVE THEN
  34. ;
  35. ; Attributes ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  36. ; animation speeds
  37. ;
  38.  
  39. kCoachMarkFastest                EQU        0
  40. kCoachMarkSlowest                EQU        31
  41. ;  sloppiness
  42.  
  43. kPerfectCoachMark                EQU        0
  44. kSloppyCoachMark                EQU        100
  45. ;  translucency
  46.  
  47. kMaxCoachMarkWeight                EQU        100
  48. kDefaultCoachMarkRegularWeight    EQU        75
  49. kDefaultCoachMarkHiddenWeight    EQU        25
  50. ;  stroke width
  51.  
  52. kDefaultCircleCoachMarkThickness EQU    12
  53. kDefaultUnderlineCoachMarkThickness EQU    8
  54. kDefaultXCoachMarkThickness        EQU        15
  55. kDefaultArrowCoachMarkThickness    EQU        7
  56. kDefaultHighlighterCoachMarkThickness EQU 5
  57. ;  Selectors ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  58.  
  59. kCircleCoachMark                EQU        1
  60. kUnderlineCoachMark                EQU        2
  61. kXCoachMark                        EQU        3
  62. kArrowCoachMark                    EQU        4
  63. kHighlighterCoachMark            EQU        5
  64. kNumCoachMarkTypes                EQU        5
  65. ; typedef UInt32                         CoachMarkType
  66.  
  67.  
  68. kCoachMarkStraight                EQU        0
  69. kCoachMarkCurvesUp                EQU        1
  70. kCoachMarkCurvesDown            EQU        2
  71. ; typedef UInt32                         CoachMarkCurvature
  72.  
  73. ;
  74. ; Flags ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  75. ; theme element inheritance flags -- is "heritage" and "inherit" too wordy?  Could use a scheme based on the word "trait"
  76. ;
  77.  
  78. kCoachOverrideThemeNothing        EQU        0
  79. kCoachOverrideThemeColor        EQU        $01
  80. kCoachOverrideThemeOpacity        EQU        $02
  81. kCoachOverrideThemeSloppiness    EQU        $04
  82. kCoachOverrideThemeStrokeWidth    EQU        $08
  83. kCoachOverrideAllThemeTraits    EQU        $FFFFFFFF
  84. ; typedef UInt32                         CoachThemeOverrideFlags
  85.  
  86.  
  87. kCoachMarkDefaultAnimation        EQU        0
  88. ; typedef UInt32                         CoachAnimationType
  89.  
  90. ;
  91. ; In which direction should the animation go? For an arrow or underline
  92. ; this is inherent in the geometry. For the others, some bit flags:
  93. ;
  94.  
  95. kCoachMarkDefaultDirection        EQU        0                    ; for circle: 
  96. kCoachMarkClockwise                EQU        $0000
  97. kCoachMarkCounterClockwise        EQU        $0001                ; X stroke direction: 
  98. kCoachMarkTopLeftToBottomRightMask EQU    $0000
  99. kCoachMarkBottomRightToTopLeftMask EQU    $0004                ; X stroke direction: 
  100. kCoachMarkTopRightToBottomLeftMask EQU    $0000
  101. kCoachMarkBottomLeftToTopRightMask EQU    $0008                ; which X stroke is first: 
  102. kCoachMarkTopLeftToBottomRightFirstMask EQU $0000
  103. kCoachMarkTopRightToBottomLeftFirstMask EQU $0010
  104. ; typedef UInt32                         CoachDirection
  105.  
  106. ;  to specify how to erase a coach mark
  107.  
  108. kCoachMarkDefaultErase            EQU        0
  109. ; typedef UInt32                         CoachMarkEraseOptions
  110.  
  111. ;
  112. ; Structures ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  113. ; opaque reference to a coach mark
  114. ;
  115.  
  116.  
  117. ;  CoachMarkRec specifies the appearance of a CoachMark
  118. CoachMarkRec            RECORD 0
  119. markType                 ds.l    1                ; offset: $0 (0)        ;  which shape of mark?
  120. themeOverrides             ds.l    1                ; offset: $4 (4)        ;  which values do we get from the theme? 
  121. color                     ds        RGBColor        ; offset: $8 (8)        ;  what color shall the CoachMark be?
  122. sound                     ds.l    1                ; offset: $E (14)        ;  sound to be played upon drawing the coachmark (*** Doesn't work in D11)
  123. regularPercentage         ds.w    1                ; offset: $12 (18)        ;  0..100    - opacity as drawn within the specified grafport
  124. hiddenPercentage         ds.w    1                ; offset: $14 (20)        ;  0..100    - opacity as drawn outside the specified grafport
  125. sloppiness                 ds.w    1                ; offset: $16 (22)        ;  0..100
  126. thickness                 ds.w    1                ; offset: $18 (24)        ;  in pixels
  127. curvature                 ds.l    1                ; offset: $1A (26)        ;  direction of bulge for line-like marks
  128. sizeof                     EQU *                    ; size:   $1E (30)
  129.                         ENDR
  130. ;  CoachMarkAnimation specifies the appearance of a coach mark's animation
  131. CoachMarkAnimation        RECORD 0
  132. effectType                 ds.l    1                ; offset: $0 (0)
  133. speed                     ds.l    1                ; offset: $4 (4)
  134. direction                 ds.l    1                ; offset: $8 (8)
  135. sizeof                     EQU *                    ; size:   $C (12)
  136.                         ENDR
  137. ;
  138. ; The Freaky Good Stuff --------------------------------------------------------------------------------------------------------------------------------------------------------------
  139. ; Creation/destruction
  140. ;
  141. ;
  142. ; extern OSStatus NewCoachMarkRef(const CoachMarkRec *appearance, CoachMarkRef *newCoachMark)
  143. ;
  144.     IF GENERATINGCFM THEN
  145.         IMPORT_CFM_FUNCTION NewCoachMarkRef
  146.     ENDIF
  147.  
  148. ;
  149. ; extern OSStatus GetNewCoachMarkRef(SInt16 resID, CoachMarkRef *newMark)
  150. ;
  151.     IF GENERATINGCFM THEN
  152.         IMPORT_CFM_FUNCTION GetNewCoachMarkRef
  153.     ENDIF
  154.  
  155. ;
  156. ; extern OSStatus DisposeCoachMark(CoachMarkRef theMark)
  157. ;
  158.     IF GENERATINGCFM THEN
  159.         IMPORT_CFM_FUNCTION DisposeCoachMark
  160.     ENDIF
  161.  
  162. ;  To specify geometry
  163. ;
  164. ; extern OSStatus CoachRectOnWindow(CoachMarkRef mark, HIWindow *window, const Rect *localRect)
  165. ;
  166.     IF GENERATINGCFM THEN
  167.         IMPORT_CFM_FUNCTION CoachRectOnWindow
  168.     ENDIF
  169.  
  170. ;
  171. ; extern OSStatus CoachGlobalRect(CoachMarkRef mark, const Rect *globalRect)
  172. ;
  173.     IF GENERATINGCFM THEN
  174.         IMPORT_CFM_FUNCTION CoachGlobalRect
  175.     ENDIF
  176.  
  177. ;
  178. ; extern OSStatus CoachStrokeOnWindow(CoachMarkRef theMark, HIWindow *window, const Point *localSource, const Point *localDest)
  179. ;
  180.     IF GENERATINGCFM THEN
  181.         IMPORT_CFM_FUNCTION CoachStrokeOnWindow
  182.     ENDIF
  183.  
  184. ;
  185. ; extern OSStatus CoachGlobalStroke(CoachMarkRef theMark, const Point *globalSource, const Point *globalDest)
  186. ;
  187.     IF GENERATINGCFM THEN
  188.         IMPORT_CFM_FUNCTION CoachGlobalStroke
  189.     ENDIF
  190.  
  191. ;  Accessors
  192. ;
  193. ; extern CoachMarkType GetCoachMarkType(CoachMarkRef theMark)
  194. ;
  195.     IF GENERATINGCFM THEN
  196.         IMPORT_CFM_FUNCTION GetCoachMarkType
  197.     ENDIF
  198.  
  199. ;
  200. ; extern HIWindow *GetCoachMarkWindow(CoachMarkRef theMark)
  201. ;
  202.     IF GENERATINGCFM THEN
  203.         IMPORT_CFM_FUNCTION GetCoachMarkWindow
  204.     ENDIF
  205.  
  206. ;
  207. ; extern OSStatus GetCoachMarkRect(CoachMarkRef mark, Rect *globalRect)
  208. ;
  209.     IF GENERATINGCFM THEN
  210.         IMPORT_CFM_FUNCTION GetCoachMarkRect
  211.     ENDIF
  212.  
  213. ;
  214. ; extern OSStatus GetCoachMarkStroke(CoachMarkRef theMark, Point *globalSource, Point *globalDest)
  215. ;
  216.     IF GENERATINGCFM THEN
  217.         IMPORT_CFM_FUNCTION GetCoachMarkStroke
  218.     ENDIF
  219.  
  220. ;
  221. ; extern OSStatus SetCoachMarkColor(CoachMarkRef theMark, const RGBColor *color)
  222. ;
  223.     IF GENERATINGCFM THEN
  224.         IMPORT_CFM_FUNCTION SetCoachMarkColor
  225.     ENDIF
  226.  
  227. ;
  228. ; extern OSStatus GetCoachMarkColor(CoachMarkRef theMark, RGBColor *color)
  229. ;
  230.     IF GENERATINGCFM THEN
  231.         IMPORT_CFM_FUNCTION GetCoachMarkColor
  232.     ENDIF
  233.  
  234. ;
  235. ; extern OSStatus SetCoachMarkRegularWeight(CoachMarkRef theMark, UInt16 weight)
  236. ;
  237.     IF GENERATINGCFM THEN
  238.         IMPORT_CFM_FUNCTION SetCoachMarkRegularWeight
  239.     ENDIF
  240.  
  241. ;
  242. ; extern UInt16 GetCoachMarkRegularWeight(CoachMarkRef theMark)
  243. ;
  244.     IF GENERATINGCFM THEN
  245.         IMPORT_CFM_FUNCTION GetCoachMarkRegularWeight
  246.     ENDIF
  247.  
  248. ;
  249. ; extern OSStatus SetCoachMarkHiddenWeight(CoachMarkRef theMark, UInt16 weight)
  250. ;
  251.     IF GENERATINGCFM THEN
  252.         IMPORT_CFM_FUNCTION SetCoachMarkHiddenWeight
  253.     ENDIF
  254.  
  255. ;
  256. ; extern UInt16 GetCoachMarkHiddenWeight(CoachMarkRef theMark)
  257. ;
  258.     IF GENERATINGCFM THEN
  259.         IMPORT_CFM_FUNCTION GetCoachMarkHiddenWeight
  260.     ENDIF
  261.  
  262. ;
  263. ; extern OSStatus SetCoachMarkThickness(CoachMarkRef theMark, UInt16 thickness)
  264. ;
  265.     IF GENERATINGCFM THEN
  266.         IMPORT_CFM_FUNCTION SetCoachMarkThickness
  267.     ENDIF
  268.  
  269. ;
  270. ; extern UInt16 GetCoachMarkThickness(CoachMarkRef theMark)
  271. ;
  272.     IF GENERATINGCFM THEN
  273.         IMPORT_CFM_FUNCTION GetCoachMarkThickness
  274.     ENDIF
  275.  
  276. ;
  277. ; extern OSStatus SetCoachMarkSloppiness(CoachMarkRef theMark, UInt16 sloppiness)
  278. ;
  279.     IF GENERATINGCFM THEN
  280.         IMPORT_CFM_FUNCTION SetCoachMarkSloppiness
  281.     ENDIF
  282.  
  283. ;
  284. ; extern UInt16 GetCoachMarkSloppiness(CoachMarkRef theMark)
  285. ;
  286.     IF GENERATINGCFM THEN
  287.         IMPORT_CFM_FUNCTION GetCoachMarkSloppiness
  288.     ENDIF
  289.  
  290. ;
  291. ; extern OSStatus SetCoachMarkCurvature(CoachMarkRef theMark, CoachMarkCurvature curvature)
  292. ;
  293.     IF GENERATINGCFM THEN
  294.         IMPORT_CFM_FUNCTION SetCoachMarkCurvature
  295.     ENDIF
  296.  
  297. ;
  298. ; extern CoachMarkCurvature GetCoachMarkCurvature(CoachMarkRef theMark)
  299. ;
  300.     IF GENERATINGCFM THEN
  301.         IMPORT_CFM_FUNCTION GetCoachMarkCurvature
  302.     ENDIF
  303.  
  304. ;
  305. ; extern OSStatus SetCoachMarkThemeOverrides(CoachMarkRef theMark, CoachThemeOverrideFlags inHeritage)
  306. ;
  307.     IF GENERATINGCFM THEN
  308.         IMPORT_CFM_FUNCTION SetCoachMarkThemeOverrides
  309.     ENDIF
  310.  
  311. ;
  312. ; extern OSStatus GetCoachMarkThemeOverrides(CoachMarkRef theMark, CoachThemeOverrideFlags *outHeritage)
  313. ;
  314.     IF GENERATINGCFM THEN
  315.         IMPORT_CFM_FUNCTION GetCoachMarkThemeOverrides
  316.     ENDIF
  317.  
  318. ;
  319. ; Drawing, animation, erasing
  320. ; CoachMarkInteraction is synchronous and applies globallly, the other three are not and require windows
  321. ;
  322. ;
  323. ; extern OSStatus CoachMarkInteraction(CoachMarkRef theMark, const CoachMarkAnimation *effect)
  324. ;
  325.     IF GENERATINGCFM THEN
  326.         IMPORT_CFM_FUNCTION CoachMarkInteraction
  327.     ENDIF
  328.  
  329. ;
  330. ; extern OSStatus AnimateCoachMark(CoachMarkRef theMark, const CoachMarkAnimation *effect)
  331. ;
  332.     IF GENERATINGCFM THEN
  333.         IMPORT_CFM_FUNCTION AnimateCoachMark
  334.     ENDIF
  335.  
  336. ;
  337. ; extern OSStatus DrawCoachMark(CoachMarkRef theMark)
  338. ;
  339.     IF GENERATINGCFM THEN
  340.         IMPORT_CFM_FUNCTION DrawCoachMark
  341.     ENDIF
  342.  
  343. ;
  344. ; extern OSStatus EraseCoachMark(CoachMarkRef theMark, CoachMarkEraseOptions options)
  345. ;
  346.     IF GENERATINGCFM THEN
  347.         IMPORT_CFM_FUNCTION EraseCoachMark
  348.     ENDIF
  349.  
  350.     ENDIF
  351.     ENDIF ; __COACHMARKS__ 
  352.  
  353.